package com.qfedu.common.core.enums;

public enum PayTypeEnum {
    PAY_ALI(2, "支付宝支付"),
    PAY_WX(1, "微信支付");

    private int type;
    private String desc;

    PayTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static PayTypeEnum getEnumByType(int type) {
        // 获取所有的枚举值
        PayTypeEnum[] values = PayTypeEnum.values();
        for (PayTypeEnum e : values) {
            if (e.getType() == type) {
                return e;
            }
        }
        return null;
    }
}
